<%--
  Created by IntelliJ IDEA.
  User: 田同学
  Date: 2022/1/15
  Time: 15:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<br><br>
<div style="position: fixed; width: 100%;height:400px;background-color: #999d9d">
    <span><label style="color: #222222">制定物料变更</label></span>

    <div class="container" style="position: fixed;left: 50%">

        <form class="form-inline" id="form_querydmode">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label for="Iselect_updatedmode">I&nbsp;级分类：</label><select id="Iselect_updatedmode"  class="form-control"style="width: 300px">
            <option value="未选择">---请选择I级分类---</option>

        </select><br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label >II&nbsp;级分类：</label><select id="IIselect_updatedmode" class="form-control "style="width: 300px">
            <option value="">---请选择II级分类---</option>
        </select><br><br>

            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label >III&nbsp;级分类：</label><select id="IIIselect_updatedmode" class="form-control "style="width: 300px">
            <option value="">---请选择III级分类---</option>
        </select><br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            请输入建档日期：<input type="date">到 <input type="date">
            <br><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" id="btnsearch_updatedmode" style="width: 500px" value="查询"  data-toggle='modal' data-target='#myModal_updatedmode' class="btn btn-success">
        </form>
    </div>

</div>

<!-- 模态框（Modal） -->
<div  class="modal fade" id="myModal_updatedmode" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_updatedmode" aria-hidden="true">
    <div class="modal-dialog"  style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_updatedmode">产品设计-- 产品物料组成设计--变更</h4>
            </div>
            <div class="modal-body" >
                <div>
                    <table id="query_updatedmode">

                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 模态框（Modal） -->
<div  class="modal fade" id="myModal_updatedmode02" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_updatedmode02" aria-hidden="true">
    <div class="modal-dialog"  style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_updatedmode02">产品设计--产品物料组成设计--变更</h4>
            </div>
            <div class="modal-body">
                <div>
                    <div style="position: relative;left: 43%"><b style="font-size: 35px">物料变更单</b></div>
                    <br><br>
                    <div id="commit_audit_div" style="position: relative;left: 84%">
                        <input type="button" style="position: relative;top: 5px;right: 3px" value="添加新物料" data-toggle='modal' data-target='#myModal_updatedmode03' class="btn btn-warning">&nbsp;&nbsp;&nbsp;
                        <input type="button"  style="position: relative;top: 5px;right: 3px" value="提交" id="commit_updatedmode" class="btn btn-success">&nbsp;&nbsp;&nbsp;
                    </div>
                    <br><br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>产品名称：</label> <span id="PRODUCT_NAME_updatedmode" style="width: 70%"></span>
                        </div>
                        <div class="col-md-6 form-inline" >
                            <div style="position: relative;left: 50%">
                                <label >产品编号：</label > <span  id="PRODUCT_ID_updatedmode"></span>
                            </div>
                        </div>
                    </div>
                    <br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>设计人：</label> <input id="DESIGNER_updatedmode"  class="form-control" style="width: 70%">
                        </div>
                        <div class="col-md-6 form-inline" >
                            <div style="position: relative;left: 50%">
                                <label>设计单编号：</label > <span  id="DESIGN_ID_updatedmode"></span>
                            </div>
                        </div>
                    </div>
                    <br>
                    <table id="table_updatedmode">

                    </table>
                    <br><br><br>
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <label>登记人：</label> <input type="text" id="register_updatedmode" class="form-control" style="width: 70%">
                        </div>
                        <div class="col-md-6 form-inline" >
                            <div style="position: relative;left: 50%">
                                <label >审核时间：</label > <span id="date_updatedmode" ></span>
                            </div>
                        </div>
                    </div>
                    <br>
                    <div>
                        <label style="position: relative;top: -45px">设计要求:</label><textarea id="MODULE_DESCRIBE_updatedmode" style="height: 100px;width: 90%"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 模态框（Modal） -->
<div  class="modal fade" id="myModal_updatedmode03" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_updatedmode03" aria-hidden="true">
    <div class="modal-dialog"  style="width: 100%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel_updatedmode03">产品设计-- 产品物料组成设计--变更</h4>
            </div>
            <div class="modal-body" >
                <div>
                    <div class="modal-body" >
                        <form id="form_update02" class="form-inline">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label for="Iselect_updatedmode03">I&nbsp;级分类：</label><select id="Iselect_updatedmode03"  class="form-control"style="width: 300px">
                            <option value="未选择">---请选择I级分类---</option>

                        </select>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label >II&nbsp;级分类：</label><select id="IIselect_updatedmode03" class="form-control "style="width: 300px">
                            <option value="">---请选择II级分类---</option>
                        </select>

                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <label >III&nbsp;级分类：</label><select id="IIIselect_updatedmode03" class="form-control "style="width: 300px">
                            <option value="">---请选择III级分类---</option>
                        </select>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            请输入建档日期：<input type="date">到 <input type="date"><br><br>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" id="btnsearch_update02" style="width: 500px;position: relative;left: 35%" value="查询"   class="btn btn-success">
                        </form>
                    </div>
                    <button class='btn btn-info' id="adddesign_updatedmode" data-dismiss="modal">添加物料</button>
                    <table id="query_updatedmode03">

                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<input type="hidden" id="pid_updatedmode">
<script>
    inln01_updatedmode(0)
    //获取下拉框值
    function inln01_updatedmode(pId){
        var pId={pId:pId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            pId,
            function (data) {
                console.log(data)
                //循环
                $(data).each(function (index,item) {
                    var option=$("<option value='"+item.kindId+""+item.id+"'>"+item.kindName+"</option>")
                    $("#Iselect_updatedmode").append(option)

                })
                $("#Iselect_updatedmode").blur(function () {
                    $("#IIselect_updatedmode>option:gt(0)").remove()
                    $("#IIIselect_updatedmode>option:gt(0)").remove()
                    var fir=$("#Iselect_updatedmode").val()
                    inln2_updatedmode(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }


    //第二个下拉框
    function inln2_updatedmode(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIselect_updatedmode>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIselect_updatedmode").append(option)
                })
                $("#IIselect_updatedmode").blur(function () {
                    var fir=$("#IIselect_updatedmode").val()
                    inln3_updatedmode(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }

    //第三个下拉框
    function inln3_updatedmode(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIIselect_updatedmode>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIIselect_updatedmode").append(option)
                })

            }),'json'
    }

    //物料查询
    var params = {
        url: "${pageContext.request.contextPath}/querybymenu02.action",
        method: 'GET',                      //请求方式（*）
        toolbar: '#toolbar',              //工具按钮用哪个容器
        striped: true,                      //是否显示行间隔色
        cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
        pagination: true,                   //是否显示分页（*）
        sortable: true,                     //是否启用排序
        sortOrder: "asc",                   //排序方式
        sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
        pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录
        pageSize: 5,                     //每页的记录行数（*）
        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）
        search: false,                      //是否显示表格搜索
        strictSearch: true,
        showColumns: true,                  //是否显示所有的列（选择显示的列）
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 500,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
        uniqueId: "id",                     //每一行的唯一标识，一般为主键列
        showToggle: true,                   //是否显示详细视图和列表视图的切换按钮
        cardView: false,                    //是否显示详细视图
        detailView: false,                  //是否显示父子表
        //传递额外的查询用的参数
        queryParams: function (params) {
            //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            var I=$("#Iselect_updatedmode").val();
            var temp = {
                pagesize: params.limit,     //页面大小
                pageno: (params.offset / params.limit) + 1,   //页码
                firstKindId:I.substring(0,2),
                secondKindName:$("#IIselect_updatedmode option:selected").text(),
                thirdKindName:$("#IIIselect_updatedmode  option:selected").text(),
            };
            return temp;
        },
        columns: [
            // {
            //     title: "全选",
            //     field: "",
            //     checkbox:true
            // },
            {
                title: "设计单编号",
                field: "designId"
            },
            {
                title: "产品编号",
                field: "productId"
            },
            {
                title: "产品名称",
                field: "productName"
            },
            {
                title: "设计人",
                field: "designer",
            },
            {
                title: "登记时间",
                field: "registerTime",
            },

            {
                title: "物料总成本",
                field: "costPriceSum",
            },
            {
                title: "变更",
                field: "",
                formatter: function (value, row, index) {
                    return "<input type='button' onclick='update("+row.id+")'  value='变更' class='btn btn-warning' data-toggle='modal' data-target='#myModal_updatedmode02'>";

                }
            }
        ]
    };
    $("#query_updatedmode").bootstrapTable(params)
    //查询
    $("#btnsearch_updatedmode").click(function () {
        $("#query_updatedmode").bootstrapTable("refresh")
    })
    //变更
    function update(id) {
        $("#pid_updatedmode").val(id)
        $("#table_updatedmode").bootstrapTable("refresh")
        $.get("${pageContext.request.contextPath}/querybyid.action",{id:id},
        function (data) {
                $("#PRODUCT_NAME_updatedmode").text(data.productName)
                $("#PRODUCT_ID_updatedmode").text(data.productId)
                $("#register_updatedmode").val(data.register)
                $("#DESIGN_ID_updatedmode").text(data.designId)
                $("#MODULE_DESCRIBE_updatedmode").val(data.moduleDescribe)
                $("#DESIGNER_updatedmode").val(data.designer)
                $("#date_updatedmode").text(data.checkTime)
        },"json")
    }

    var params = {
        url: "${pageContext.request.contextPath}/querybypid.action",
        method: 'GET',                      //请求方式（*）
        <%--    toolbar: '#div_design03',              //工具按钮用哪个容器--%>
        striped: true,                      //是否显示行间隔色
        <%--    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）--%>
        <%--    pagination: true,                   //是否显示分页（*）--%>
        <%--    sortable: true,                     //是否启用排序--%>
        <%--    sortOrder: "asc",                   //排序方式--%>
        <%--    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）--%>
        <%--    pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录--%>
        <%--    pageSize: 5,                     //每页的记录行数（*）--%>
        <%--    pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）--%>
        <%--    search: false,                      //是否显示表格搜索--%>
        <%--    strictSearch: true,--%>
        <%--    showColumns: true,                  //是否显示所有的列（选择显示的列）--%>
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 200,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
        <%--    uniqueId: "id",                     //每一行的唯一标识，一般为主键列--%>
        <%--    showToggle: true,                   //是否显示详细视图和列表视图的切换按钮--%>
        <%--    cardView: false,                    //是否显示详细视图--%>
        <%--    detailView: false,                  //是否显示父子表--%>
        <%--    //传递额外的查询用的参数--%>
        queryParams: function (params) {
            //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            var temp = {
                pagesize: params.limit,     //页面大小
                pageno: (params.offset / params.limit) + 1,   //页码
                id:$("#pid_updatedmode").val()
            };
            return temp;
        },
        columns: [
            // {
            //     title: "全选",
            //     field: "",
            //     checkbox:true
            // },
            {
                title: "序号",
                field: "detailsNumber",
            },
            {
                title: "物料编号",
                field: "productId",
            },
            {
                title: "物料名称",
                field: "productName"
            },
            {
                title:"描述",
                field: "productDescribe",
            },
            {
                title: "用途类型",
                field: "type",
                formatter:function (value) {
                    if (value=="Y001-1"){
                        return "商品";
                    }else
                    if (value=="Y001-2"){
                        return "物料";
                    }
                }
            },
            {
                title: "数量",
                field: "amount",
                formatter:function(value){

                    return"<input type='number' value='"+value+"' required='true' placeholder='请输入数量'  name='num_updatedmode'  class='form-control'>";
                }
            },
            {
                title: "单位",
                field: "amountUnit",
            },
            {
                title: "计划成本单价",
                field: "costPrice",
            },
            {
                title: "小计",
                field: "subtotal",
            }
        ]
    };
    $("#table_updatedmode").bootstrapTable(params);

    //第三个table
    var params = {
        url: "${pageContext.request.contextPath}/querybyAlldfile.action",
        method: 'GET',                      //请求方式（*）
        <%--    toolbar: '#div_design03',              //工具按钮用哪个容器--%>
        striped: true,                      //是否显示行间隔色
        <%--    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）--%>
        <%--    pagination: true,                   //是否显示分页（*）--%>
        <%--    sortable: true,                     //是否启用排序--%>
        <%--    sortOrder: "asc",                   //排序方式--%>
        <%--    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）--%>
        <%--    pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录--%>
        <%--    pageSize: 5,                     //每页的记录行数（*）--%>
        <%--    pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数（*）--%>
        <%--    search: false,                      //是否显示表格搜索--%>
        <%--    strictSearch: true,--%>
        <%--    showColumns: true,                  //是否显示所有的列（选择显示的列）--%>
        showRefresh: true,                  //是否显示刷新按钮
        minimumCountColumns: 2,             //最少允许的列数
        clickToSelect: true,                //是否启用点击选中行
        height: 200,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
        <%--    uniqueId: "id",                     //每一行的唯一标识，一般为主键列--%>
        <%--    showToggle: true,                   //是否显示详细视图和列表视图的切换按钮--%>
        <%--    cardView: false,                    //是否显示详细视图--%>
        <%--    detailView: false,                  //是否显示父子表--%>
        <%--    //传递额外的查询用的参数--%>
            queryParams: function (params) {
                var I=$("#Iselect_updatedmode03").val();
                //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                var temp = {
                    pagesize: params.limit,     //页面大小
                    pageno: (params.offset / params.limit) + 1,   //页码
                    //查询条件
                    firstKindId:I.substring(0,2),
                    type:"Y001-2",
                    secondKindName:$("#IIselect_updatedmode03 option:selected").text(),
                    thirdKindName:$("#IIIselect_updatedmode03 option:selected").text()
                };
                return temp;
            },
        columns: [
            {
                title: "全选",
                field: "",
                checkbox:true
            },
            {
                title: "物料编号",
                field: "productId",
            },
            {
                title: "物料名称",
                field: "productName"
            },
            {
                title:"描述",
                field: "productDescribe",
            },
            {
                title: "用途类型",
                field: "type",
                formatter:function (value) {
                    if (value=="Y001-1"){
                        return "商品";
                    }else
                    if (value=="Y001-2"){
                        return "物料";
                    }
                }
            },
            {
                title: "单位",
                field: "amountUnit",
            },
            {
                title: "计划成本单价",
                field: "costPrice",
            },
            {
                title: "小计",
                field: "",
                formatter:function (value,row,index) {

                }
            }
        ]
    };
    $("#query_updatedmode03").bootstrapTable(params);


    $("#btnsearch_update02").click(function () {
        //条件查询
        //刷新表格数据
        $("#query_updatedmode03").bootstrapTable("refresh");
        setTimeout(function () {
            $("#form_update02").resetForm();
        },5000)
    })

    var dModule;
    $("#commit_updatedmode").click(function () {
        //获取父表数据
        dModule={
            //id
            id:$("#pid_updatedmode").val(),
            //设计人
            designer:$("#DESIGNER_updatedmode").val(),
            //登记人
            register:$("#register_updatedmode").val(),
            //设计要求
            moduleDescribe:$("#MODULE_DESCRIBE_updatedmode").val(),
            //checkTag
            checkTag:"S001-0",
            //changeTag
            changeTag:"B002-1"
        }


        //子表数据
        var arr= $("#table_updatedmode").bootstrapTable("getData");
        var trs01= $("#table_updatedmode tr");

                //alert($(trs[index+1]).find("input[name='num_design']").val())
                if ($(trs01).find("input[name='num_updatedmode']").val()!=""){
                    //提交
                        var arr= $("#table_updatedmode").bootstrapTable("getData");
                        var trs= $("#table_updatedmode tr");
                        var dModuleDetails=[];
                        $(arr).each(function (index,item) {
                            var temp={
                                productId:item.productId,
                                productName:item.productName,
                                type:item.type,
                                productDescribe:item.productDescribe,
                                amountUnit:item.amountUnit,
                                amount:$(trs[index+1]).find("input[name='num_updatedmode']").val(),
                                residualAmount:$(trs[index+1]).find("input[name='num_updatedmode']").val(),
                                costPrice:item.costPrice,
                                //subtotal:"123.00"
                            }
                            dModuleDetails.push(temp)
                        })
                        dModule["details"]=dModuleDetails;

                        var param={
                            url:"${pageContext.request.contextPath}/updateNewDmdule.action",
                            type:"put",
                            data:JSON.stringify(dModule),
                            dataType:"json",
                            contentType:"application/json",
                            success:function (data) {
                                alert(data.msg)
                                if (data.code>0){
                                    $("#query_updatedmode").bootstrapTable("refresh");
                                    $("#myModal_updatedmode02").modal("hide");
                                    //$("#query_design03").bootstrapTable("remove");

                                }
                            }
                        }
                        $.ajax(param)

                    //当前时间
                    $(document).ready(function () {
                        var starDate =new Date();
                        $("#date_design").text(starDate.getFullYear()
                            +"-"+starDate.getMonth()+1
                            +"-"+starDate.getDate()
                            +" "+starDate.getHours()
                            +":"+starDate.getMinutes()
                            +":"+starDate.getSeconds()
                        )
                    })

                }





    })
    //添加物料
    $("#adddesign_updatedmode").click(function () {
        na_de= $("#query_updatedmode03").bootstrapTable("getAllSelections");
        $("#table_updatedmode").bootstrapTable("load",na_de)
        alert("添加成功")
    })

    inln01_updatedmode02(0)
    //获取下拉框值
    function inln01_updatedmode02(pId){
        var pId={pId:pId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            pId,
            function (data) {
                console.log(data)
                //循环
                $(data).each(function (index,item) {
                    var option=$("<option value='"+item.kindId+""+item.id+"'>"+item.kindName+"</option>")
                    $("#Iselect_updatedmode03").append(option)

                })
                $("#Iselect_updatedmode03").blur(function () {
                    $("#IIselect_updatedmode03>option:gt(0)").remove()
                    $("#IIIselect_updatedmode03>option:gt(0)").remove()
                    var fir=$("#Iselect_updatedmode03").val()
                    inln02_updatedmode02(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }


    //第二个下拉框
    function inln02_updatedmode02(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIselect_updatedmode03>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIselect_updatedmode03").append(option)
                })
                $("#IIselect_updatedmode03").blur(function () {
                    var fir=$("#IIselect_updatedmode03").val()
                    inln03_updatedmode02(fir.substring(2),fir.substring(0,2))
                })

            }),'json'
    }

    //第三个下拉框
    function inln03_updatedmode02(pId,kindId){
        var dco={pId:pId,kindId:kindId};
        $.get("${pageContext.request.contextPath}/queryPull_design.action",
            dco,
            function (data) {
                console.log(data)
                //循环
                $("#IIIselect_updatedmode03>option:gt(0)").remove()
                $(data).each(function (index, item) {
                    var option = $("<option value='"+item.kindId+""+item.id+"'>" + item.kindName + "</option>")
                    $("#IIIselect_updatedmode03").append(option)
                })

            }),'json'
    }
</script>
</body>
</html>
